/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Traffic;

import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JPanel;

/**
 *
 * @author Matthew
 */
public class TrafficLightTesterPanel extends JPanel{
    public LightState[] ls;

    public void paint(Graphics g)
    {
        g.setColor(Color.black);
        g.fillRect(0,0,getWidth(),getHeight());


        int xWid = getWidth()/8;
        int yWid = getHeight()/3;
        int xPos = 0;
        int yPos = 0;

        for (LightState l:ls)
        {
            switch(l)
            {
                case RED:
                    g.setColor(Color.red);
                    yPos = 0;
                    break;
                case YELLOW:
                    g.setColor(Color.yellow);
                    yPos = yWid;
                    break;
                case GREEN:
                    g.setColor(Color.green);
                    yPos = yWid * 2;
                    break;
            }
            g.fillOval(xPos, yPos, xWid, yWid);
            xPos += xWid;
        }
    }

}
